package com.zzy.study.io;

import java.io.ByteArrayInputStream;
import java.io.IOException;

public class TestByteArrayInputStream {
	
	public static void main(String[] args) throws IOException {
		byte[] buffer = "this is a test".getBytes();
		ByteArrayInputStream in = new ByteArrayInputStream(buffer);
		System.out.println(in.read());
		byte[] newBuffer = new byte[10];
		in.read(newBuffer, 0, 3);
		in.reset();
		in.read(newBuffer, 0, 3);
	}
	
}
